﻿using ERP.Common.Results;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using ERP.Entity;
using ERP.UserLogin.IService;

//namespace ERP.Web.Controllers.wyx.Login
//{
//    /// <summary>
//    /// 登陆控制器
//    /// </summary>
//    [Route("api/[controller]/[action]")]
//    [ApiController]
//    public class LoginController : ControllerBase
//    {
//        /// <summary>
//        /// 登陆接口
//        /// </summary>
//        private readonly ILoginService _loginService;
//        /// <summary>
//        /// 构造函数
//        /// </summary>
//        /// <param name="loginService">登陆接口</param>
//        public LoginController(ILoginService loginService)
//        {
//            _loginService = loginService;
//        }

        /// <summary>
        /// 登陆
        /// </summary>
        /// <param name="username">用户名</param>
        /// <param name="password">密码</param>
        /// <returns>返回任务</returns>
        [HttpGet]
        public async Task<APIResult<User>> LoginQuery(string username, string password)
        {
            return await _loginService.LoginQuery(username, password);
        }
    }
}
